/**
 * File              : main.c
 * Author            : Major Lin <mingjie.lin@nxp.com>
 * Date              : 01.08.2019
 * Last Modified Date: 01.08.2019
 * Last Modified By  : Major Lin <mingjie.lin@nxp.com>
 */
//
// demo.c -- Simple demonstration program
//
//  Copyright (c) 2012-2013 Andrew Payne <andy@payne.org>
//

#include <stdio.h>
#include "common.h"
#include "drv/uart_pl011_drv.h"
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"

uint32_t SystemCoreClock = 100000000;
void test_task_1(void *pvParameters)
{
    while(1){
        printf("Task 1.\r\n");
        vTaskDelay(500/portTICK_RATE_MS);
    }
}
void test_task_2(void *pvParameters)
{
    while(1){
        printf("Task 2.\r\n");
        vTaskDelay(1000/portTICK_RATE_MS);
    }
}

// Main program
int main(void)
{
    env_init();
    printf("Hello World!\r\n");
    xTaskCreate(test_task_1, "Test Task1", 1000, NULL, tskIDLE_PRIORITY + 3, NULL);
    xTaskCreate(test_task_2, "Test Task2", 1000, NULL, tskIDLE_PRIORITY + 3, NULL);
    printf("Start FreeRTOS\r\n");
    vTaskStartScheduler();
    asm("WFI");
}
